package com.moyu.blog.controller;

import com.moyu.blog.service.ArticleService;
import com.moyu.blog.vo.Result;
import com.moyu.blog.vo.param.PageParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController//通过json格式交互
@RequestMapping("articles")//路由
public class ArticleController {


    @Autowired
    private ArticleService articleService;
    /**
     * 首页文章列表
     * @param pageParam
     * @return
     */
    @PostMapping
    public Result listArticle(@RequestBody PageParam pageParam){
        return articleService.listArticle(pageParam);
    }
}
